<template>
  <div class=''>Home</div>
  <el-button type="primary" @click='toLogin'>登陆</el-button>
</template>

<script setup lang="ts">
import { LoginResult, login } from '@/api/backend/auth';
import { ref ,Ref} from 'vue';



let loginResultRef:Ref<LoginResult> = ref<LoginResult>({code:0,msg:"haha"})


async function toLogin(){
  login({username:"zz",password:"123"}).then((result:LoginResult)=>{
    loginResultRef.value=result
    alert(loginResultRef.value.data?.token)
  })
}
</script>
<style scoped>

</style>


